function ret_val = max_coords(matrix_2d)
%-------------------------------------------------------------------------
%Returns the x and y coordinates for the maximum point in a 2 dimensional
% matrix as a 2-element vector
%-------------------------------------------------------------------------
[maxs, inds] = max(matrix_2d);
[ma, ia] = max(maxs);

ret_val = [ia, inds(ia)];
